<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
    <th:block th:include="include :: header('修改打卡记录')" />
    <th:block th:include="include :: datetimepicker-css" />
</head>
<body class="white-bg">
    <div class="wrapper wrapper-content animated fadeInRight ibox-content">
        <form class="form-horizontal m" id="form-in-edit" th:object="${personnelClockIn}">
            <input name="id" th:field="*{id}" type="hidden">

            <div class="form-group">
                <label class="col-sm-3 control-label">人员：</label>
                <div class="col-sm-8">
                    <select class="form-control m-b" th:field="*{userId}" id="userId" name="userId">
                        <option value="">--人员选择--</option>
                        <option th:each="personnelUser : ${personnelUserList}"
                                th:text="${personnelUser.userName}"
                                th:value="${personnelUser.id}">

                        </option>
                    </select>
                </div>
            </div>

            <div class="form-group">
                <label class="col-sm-3 control-label">开门类型：</label>
                <div class="col-sm-8">
                    <select class="form-control m-b"  th:field="*{doorType}" id="doorType" name="doorType">
                        <option value="刷脸">刷脸</option>
                        <option value="APP">APP</option>
                    </select>
                </div>
            </div>


            <div class="form-group">
                <label class="col-sm-3 control-label">开门日期：</label>
                <div class="col-sm-8">
                    <div class="input-group date">
                        <input name="doorTime" th:value="${#dates.format(personnelClockIn.doorTime, 'yyyy-MM-dd HH:mm:ss')}"
                               lay-key="3" class="form-control" placeholder="yyyy-MM-dd HH:mm:ss" type="text">
                        <span class="input-group-addon"><i class="fa fa-calendar"></i></span>
                    </div>
                </div>
            </div>
        </form>
    </div>
    <th:block th:include="include :: footer" />
    <th:block th:include="include :: datetimepicker-js" />
    <script th:inline="javascript">
        var prefix = ctx + "system/in";
        $("#form-in-edit").validate({
            focusCleanup: true
        });

        function submitHandler() {
            if ($.validate.form()) {
                $.operate.save(prefix + "/edit", $('#form-in-edit').serialize());
            }
        }

        $("input[name='doorTime']").datetimepicker({
            format: "yyyy-mm-dd",
            minView: "month",
            autoclose: true
        });
    </script>
</body>
</html>
